# -*- coding:utf-8 -*-
"""
@Time:  2024/5/11 10:32
@Auth:  Mrs.Gou 
@Function:  列表的遍历---影响一辈子
"""

# 名字列表
my_name = ['will', 'roy', 'tufei', '卡卡']
my_num = [1001, 1002, 1003, 1004]

# 点名
# 遍历：指沿着某条搜索路线，依次对列表中的每个结点均做一次且仅做一次访问

# 成员遍历(只读)
for n in my_name:
    print(n)
# 下标遍历(读写)
for i in range(len(my_name)):
    print(my_name[i])
    my_name[i] += '_' + str(my_num[i])
print(my_name)

# 不建议在遍历的同时进行append和remove
for n in my_name:
    my_name.remove(n)
    print(n)